<?php
	
	require_once getcwd().'/data.impl/ShotDayRepository.php';
	require_once getcwd().'/data.models/ShotDayRepo.php';
	require_once getcwd().'service/IManager.php';
	//spl_autoload_register('managerAutoload');
	
	function managerAutoload($classname){
		//require_once getcwd().'/data.impl/' . $classname . '.php';
		//require_once getcwd().'/models/' . $classname . '.php';
	}
	
	class Manager {
		public $repository;
		public $model;
		
		//parametre : interface repository
		public function __construct(){			
			//$this->repository = new 
			
		}
		
		
		public function insertObject($object){
			/*echo "insertObject";
			$this->repository = new ShotDayRepository();
			$repo =$this->repository;
			$this->model = $this->createModelRepoFromModel($object);			
			$val =$repo->insertObject($this->model);
			//var_dump($val);
			return $val;
			*/
		}
		
		//Shot
		public function getAllById($id){
			/*
			$this->repository = new ShotDayRepository();
			$repo = $this->repository;
			$shot = $repo->getShots($id);
			return $shot;*/
		}
		
		public function getObjectsByDate($id,$y,$m,$d){
			/*
			$this->repository = new ShotDayRepository();
			$repo = $this->repository;
			$result = $repo->getObjectsByDate($id,$y,$m,$d);
			return $result;*/
		}
		
		//Shot 
		public function createModelRepoFromModel($model){
		
		}
		
		
		public function generateId(){			
			$code = md5(uniqid(rand(), true));
			return substr($code, 0, 5);
		}
	}
	
?>